#include <string.h>
#include <stdlib.h>
#include "configure.h"
#include "log.h"

void LogFileLine(char* f, int l)
{
    char buf[10];
    char* p = 0;

    p = (char*)strrchr(f, '\\');
    if (p)
    {
	TWI_SendTo(LOG_MASTER, ++p);
    }
    else
    {
	TWI_SendTo(LOG_MASTER, f);
    }
    TWI_SendCharTo(LOG_MASTER, ':');
    itoa(buf, l, 10);
    TWI_SendTo(LOG_MASTER, buf);
    TWI_SendCharTo(LOG_MASTER, '\n');
}

void LogChar(char ch)
{
    TWI_SendCharTo(LOG_MASTER, ch);
}

void LogMessage(char* m)
{
    TWI_SendTo(LOG_MASTER, m);
    TWI_SendCharTo(LOG_MASTER, '\n');
}
